package com.atguigu.flow.demo;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import com.atguigu.flow.comm.Tokentime;
import com.atguigu.flow.config.DgMVCProperties;
import com.atguigu.flow.entity.LoginBO;
import com.atguigu.flow.entity.ParamBO;
import com.atguigu.flow.entity.UserListBO;
import com.atguigu.flow.entity.vo.TokenInfoBO;
import com.atguigu.flow.service.*;
import com.atguigu.flow.utils.*;

import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.apache.logging.log4j.util.Strings;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;

import org.springframework.test.context.junit4.SpringRunner;

import javax.imageio.IIOException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

@RunWith(SpringRunner.class)
@SpringBootTest
@Slf4j
@MapperScan("com.atguigu.flow.mapper")


public
class Usertest {
   @Autowired
   private UserListService userListService;
    @Autowired
    private  RedisTemplate<String, String> redisTemplate;
    @Autowired
    private SysApiService sysApiService;
    @Autowired
    private ItemsService itemsService;
    @Autowired
    private
    CustomersService customersService;

    @Autowired
    private
    SalesOrdersService salesOrdersService;


    @Autowired
    DgMVCProperties wxMVCProperties;

    final static String SLAT = "loie_api";

    @Test
    public void password_md5() {
        String password = "123456";
        password = SecureUtil.MD5Encode(password);
        System.out.println(password);
    }
    @Test
    public void date_combine() throws Exception {
        Calendar now = Calendar.getInstance();
//        System.out.println("年：" + now.get(Calendar.YEAR));
//        System.out.println("月：" + (now.get(Calendar.MONTH) + 1));
//        System.out.println("日：" + now.get(Calendar.DAY_OF_MONTH));
//        System.out.println("时：" + now.get(Calendar.HOUR_OF_DAY));
//        System.out.println("分：" + now.get(Calendar.MINUTE));
//        System.out.println("秒：" + now.get(Calendar.SECOND));
//        int hh=now.get(Calendar.HOUR_OF_DAY);
//        int mm=now.get(Calendar.MINUTE);
//        int dd=now.get(Calendar.SECOND);
//
//       String str=String.format("2023-07-01 %d:%d:%d",hh,mm,dd);
//        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");


        Date date= DateUtil.formatdatetime("2023-06-28");
        System.out.println(date);
//        Date d = new Date();
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        System.out.println("当前时间：" + sdf.format(d));
    }

    @Test
    public void test_permissoins() throws Exception {
        String modulename="外销合同";
        String recordid="";
        String username="徐威";
        JSONObject json=salesOrdersService.customersshowlist(modulename,recordid,username);
        System.out.println(json);

    }
    @Test
    public void test_config(){
        String configs[]=(wxMVCProperties.getContextInterceptorExcludePathPatterns());
        for (String notifystr : configs) {
            System.out.println(notifystr);
        }

    }

    @Test
    public void test_username() throws  Exception{
        LoginBO bo=new LoginBO();
        bo.setUserName("admin");
        //2023-05-10 23:48:51loie_api25D55AD283AA400AF464C76D713C07AD
        bo.setLoginDate("2023-05-10 23:48:51");
        String password="123456";
        password=SecureUtil.MD5Encode(password);

        String comparePasswd = bo.getLoginDate() + SLAT + password;
        comparePasswd=SecureUtil.MD5Encode(comparePasswd);
        bo.setPassword(comparePasswd);
        UserListBO userListBO = userListService.getUserInfoByUser(bo.getUserName());
        System.out.println(userListBO);
        System.out.println(bo);
    }
    @Test
    public void fedex_shipments_test() throws IOException {
        String json="{\n" +
                "  \"mergeLabelDocOption\": \"LABELS_AND_DOCS\",\n" +
                "  \"requestedShipment\": {\n" +
                "    \"shipDatestamp\": \"2019-10-14\",\n" +
                "    \"totalDeclaredValue\": {\n" +
                "      \"amount\": 12.45,\n" +
                "      \"currency\": \"USD\"\n" +
                "    },\n" +
                "    \"shipper\": {\n" +
                "      \"address\": {\n" +
                "        \"streetLines\": [\n" +
                "          \"10 FedEx Parkway\",\n" +
                "          \"Suite 302\"\n" +
                "        ],\n" +
                "        \"city\": \"Beverly Hills\",\n" +
                "        \"stateOrProvinceCode\": \"CA\",\n" +
                "        \"postalCode\": \"90210\",\n" +
                "        \"countryCode\": \"US\",\n" +
                "        \"residential\": false\n" +
                "      },\n" +
                "      \"contact\": {\n" +
                "        \"personName\": \"John Taylor\",\n" +
                "        \"emailAddress\": \"sample@company.com\",\n" +
                "        \"phoneExtension\": \"91\",\n" +
                "        \"phoneNumber\": \"XXXX567890\",\n" +
                "        \"companyName\": \"Fedex\"\n" +
                "      },\n" +
                "      \"tins\": [\n" +
                "        {\n" +
                "          \"number\": \"XXX567\",\n" +
                "          \"tinType\": \"FEDERAL\",\n" +
                "          \"usage\": \"usage\",\n" +
                "          \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "          \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "        }\n" +
                "      ]\n" +
                "    },\n" +
                "    \"soldTo\": {\n" +
                "      \"address\": {\n" +
                "        \"streetLines\": [\n" +
                "          \"10 FedEx Parkway\",\n" +
                "          \"Suite 302\"\n" +
                "        ],\n" +
                "        \"city\": \"Beverly Hills\",\n" +
                "        \"stateOrProvinceCode\": \"CA\",\n" +
                "        \"postalCode\": \"90210\",\n" +
                "        \"countryCode\": \"US\",\n" +
                "        \"residential\": false\n" +
                "      },\n" +
                "      \"contact\": {\n" +
                "        \"personName\": \"John Taylor\",\n" +
                "        \"emailAddress\": \"sample@company.com\",\n" +
                "        \"phoneExtension\": \"91\",\n" +
                "        \"phoneNumber\": \"1234567890\",\n" +
                "        \"companyName\": \"Fedex\"\n" +
                "      },\n" +
                "      \"tins\": [\n" +
                "        {\n" +
                "          \"number\": \"123567\",\n" +
                "          \"tinType\": \"FEDERAL\",\n" +
                "          \"usage\": \"usage\",\n" +
                "          \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "          \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "        }\n" +
                "      ],\n" +
                "      \"accountNumber\": {\n" +
                "        \"value\": \"Your account number\"\n" +
                "      }\n" +
                "    },\n" +
                "    \"recipients\": [\n" +
                "      {\n" +
                "        \"address\": {\n" +
                "          \"streetLines\": [\n" +
                "            \"10 FedEx Parkway\",\n" +
                "            \"Suite 302\"\n" +
                "          ],\n" +
                "          \"city\": \"Beverly Hills\",\n" +
                "          \"stateOrProvinceCode\": \"CA\",\n" +
                "          \"postalCode\": \"90210\",\n" +
                "          \"countryCode\": \"US\",\n" +
                "          \"residential\": false\n" +
                "        },\n" +
                "        \"contact\": {\n" +
                "          \"personName\": \"John Taylor\",\n" +
                "          \"emailAddress\": \"sample@company.com\",\n" +
                "          \"phoneExtension\": \"000\",\n" +
                "          \"phoneNumber\": \"XXXX345671\",\n" +
                "          \"companyName\": \"FedEx\"\n" +
                "        },\n" +
                "        \"tins\": [\n" +
                "          {\n" +
                "            \"number\": \"123567\",\n" +
                "            \"tinType\": \"FEDERAL\",\n" +
                "            \"usage\": \"usage\",\n" +
                "            \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "            \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"deliveryInstructions\": \"Delivery Instructions\"\n" +
                "      }\n" +
                "    ],\n" +
                "    \"recipientLocationNumber\": \"1234567\",\n" +
                "    \"pickupType\": \"USE_SCHEDULED_PICKUP\",\n" +
                "    \"serviceType\": \"PRIORITY_OVERNIGHT\",\n" +
                "    \"packagingType\": \"YOUR_PACKAGING\",\n" +
                "    \"totalWeight\": 20.6,\n" +
                "    \"origin\": {\n" +
                "      \"address\": {\n" +
                "        \"streetLines\": [\n" +
                "          \"10 FedEx Parkway\",\n" +
                "          \"Suite 302\"\n" +
                "        ],\n" +
                "        \"city\": \"Beverly Hills\",\n" +
                "        \"stateOrProvinceCode\": \"CA\",\n" +
                "        \"postalCode\": \"38127\",\n" +
                "        \"countryCode\": \"US\",\n" +
                "        \"residential\": false\n" +
                "      },\n" +
                "      \"contact\": {\n" +
                "        \"personName\": \"person name\",\n" +
                "        \"emailAddress\": \"email address\",\n" +
                "        \"phoneNumber\": \"phone number\",\n" +
                "        \"phoneExtension\": \"phone extension\",\n" +
                "        \"companyName\": \"company name\",\n" +
                "        \"faxNumber\": \"fax number\"\n" +
                "      }\n" +
                "    },\n" +
                "    \"shippingChargesPayment\": {\n" +
                "      \"paymentType\": \"SENDER\",\n" +
                "      \"payor\": {\n" +
                "        \"responsibleParty\": {\n" +
                "          \"address\": {\n" +
                "            \"streetLines\": [\n" +
                "              \"10 FedEx Parkway\",\n" +
                "              \"Suite 302\"\n" +
                "            ],\n" +
                "            \"city\": \"Beverly Hills\",\n" +
                "            \"stateOrProvinceCode\": \"CA\",\n" +
                "            \"postalCode\": \"90210\",\n" +
                "            \"countryCode\": \"US\",\n" +
                "            \"residential\": false\n" +
                "          },\n" +
                "          \"contact\": {\n" +
                "            \"personName\": \"John Taylor\",\n" +
                "            \"emailAddress\": \"sample@company.com\",\n" +
                "            \"phoneNumber\": \"XXXX567890\",\n" +
                "            \"phoneExtension\": \"phone extension\",\n" +
                "            \"companyName\": \"Fedex\",\n" +
                "            \"faxNumber\": \"fax number\"\n" +
                "          },\n" +
                "          \"accountNumber\": {\n" +
                "            \"value\": \"Your account number\"\n" +
                "          }\n" +
                "        }\n" +
                "      }\n" +
                "    },\n" +
                "    \"shipmentSpecialServices\": {\n" +
                "      \"specialServiceTypes\": [\n" +
                "        \"THIRD_PARTY_CONSIGNEE\",\n" +
                "        \"PROTECTION_FROM_FREEZING\"\n" +
                "      ],\n" +
                "      \"etdDetail\": {\n" +
                "        \"attributes\": [\n" +
                "          \"POST_SHIPMENT_UPLOAD_REQUESTED\"\n" +
                "        ],\n" +
                "        \"attachedDocuments\": [\n" +
                "          {\n" +
                "            \"documentType\": \"PRO_FORMA_INVOICE\",\n" +
                "            \"documentReference\": \"DocumentReference\",\n" +
                "            \"description\": \"PRO FORMA INVOICE\",\n" +
                "            \"documentId\": \"090927d680038c61\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"requestedDocumentTypes\": [\n" +
                "          \"VICS_BILL_OF_LADING\",\n" +
                "          \"GENERAL_AGENCY_AGREEMENT\"\n" +
                "        ]\n" +
                "      },\n" +
                "      \"returnShipmentDetail\": {\n" +
                "        \"returnEmailDetail\": {\n" +
                "          \"merchantPhoneNumber\": \"19012635656\",\n" +
                "          \"allowedSpecialService\": [\n" +
                "            \"SATURDAY_DELIVERY\"\n" +
                "          ]\n" +
                "        },\n" +
                "        \"rma\": {\n" +
                "          \"reason\": \"Wrong Size or Color\"\n" +
                "        },\n" +
                "        \"returnAssociationDetail\": {\n" +
                "          \"shipDatestamp\": \"2019-10-01\",\n" +
                "          \"trackingNumber\": \"123456789\"\n" +
                "        },\n" +
                "        \"returnType\": \"PRINT_RETURN_LABEL\"\n" +
                "      },\n" +
                "      \"deliveryOnInvoiceAcceptanceDetail\": {\n" +
                "        \"recipient\": {\n" +
                "          \"address\": {\n" +
                "            \"streetLines\": [\n" +
                "              \"23, RUE JOSEPH-DE MA\",\n" +
                "              \"Suite 302\"\n" +
                "            ],\n" +
                "            \"city\": \"Beverly Hills\",\n" +
                "            \"stateOrProvinceCode\": \"CA\",\n" +
                "            \"postalCode\": \"90210\",\n" +
                "            \"countryCode\": \"US\",\n" +
                "            \"residential\": false\n" +
                "          },\n" +
                "          \"contact\": {\n" +
                "            \"personName\": \"John Taylor\",\n" +
                "            \"emailAddress\": \"sample@company.com\",\n" +
                "            \"phoneExtension\": \"000\",\n" +
                "            \"phoneNumber\": \"1234567890\",\n" +
                "            \"companyName\": \"Fedex\"\n" +
                "          },\n" +
                "          \"tins\": [\n" +
                "            {\n" +
                "              \"number\": \"123567\",\n" +
                "              \"tinType\": \"FEDERAL\",\n" +
                "              \"usage\": \"usage\",\n" +
                "              \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "              \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"deliveryInstructions\": \"Delivery Instructions\"\n" +
                "        }\n" +
                "      },\n" +
                "      \"internationalTrafficInArmsRegulationsDetail\": {\n" +
                "        \"licenseOrExemptionNumber\": \"9871234\"\n" +
                "      },\n" +
                "      \"pendingShipmentDetail\": {\n" +
                "        \"pendingShipmentType\": \"EMAIL\",\n" +
                "        \"processingOptions\": {\n" +
                "          \"options\": [\n" +
                "            \"ALLOW_MODIFICATIONS\"\n" +
                "          ]\n" +
                "        },\n" +
                "        \"recommendedDocumentSpecification\": {\n" +
                "          \"types\": \"ANTIQUE_STATEMENT_EUROPEAN_UNION\"\n" +
                "        },\n" +
                "        \"emailLabelDetail\": {\n" +
                "          \"recipients\": [\n" +
                "            {\n" +
                "              \"emailAddress\": \"neena@fedex.com\",\n" +
                "              \"optionsRequested\": {\n" +
                "                \"options\": [\n" +
                "                  \"PRODUCE_PAPERLESS_SHIPPING_FORMAT\",\n" +
                "                  \"SUPPRESS_ACCESS_EMAILS\"\n" +
                "                ]\n" +
                "              },\n" +
                "              \"role\": \"SHIPMENT_COMPLETOR\",\n" +
                "              \"locale\": \"en_US\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"message\": \"your optional message\"\n" +
                "        },\n" +
                "        \"attachedDocuments\": [\n" +
                "          {\n" +
                "            \"documentType\": \"PRO_FORMA_INVOICE\",\n" +
                "            \"documentReference\": \"DocumentReference\",\n" +
                "            \"description\": \"PRO FORMA INVOICE\",\n" +
                "            \"documentId\": \"090927d680038c61\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"expirationTimeStamp\": \"2020-01-01\"\n" +
                "      },\n" +
                "      \"holdAtLocationDetail\": {\n" +
                "        \"locationId\": \"YBZA\",\n" +
                "        \"locationContactAndAddress\": {\n" +
                "          \"address\": {\n" +
                "            \"streetLines\": [\n" +
                "              \"10 FedEx Parkway\",\n" +
                "              \"Suite 302\"\n" +
                "            ],\n" +
                "            \"city\": \"Beverly Hills\",\n" +
                "            \"stateOrProvinceCode\": \"CA\",\n" +
                "            \"postalCode\": \"38127\",\n" +
                "            \"countryCode\": \"US\",\n" +
                "            \"residential\": false\n" +
                "          },\n" +
                "          \"contact\": {\n" +
                "            \"personName\": \"person name\",\n" +
                "            \"emailAddress\": \"email address\",\n" +
                "            \"phoneNumber\": \"phone number\",\n" +
                "            \"phoneExtension\": \"phone extension\",\n" +
                "            \"companyName\": \"company name\",\n" +
                "            \"faxNumber\": \"fax number\"\n" +
                "          }\n" +
                "        },\n" +
                "        \"locationType\": \"FEDEX_ONSITE\"\n" +
                "      },\n" +
                "      \"shipmentCODDetail\": {\n" +
                "        \"addTransportationChargesDetail\": {\n" +
                "          \"rateType\": \"ACCOUNT\",\n" +
                "          \"rateLevelType\": \"BUNDLED_RATE\",\n" +
                "          \"chargeLevelType\": \"CURRENT_PACKAGE\",\n" +
                "          \"chargeType\": \"COD_SURCHARGE\"\n" +
                "        },\n" +
                "        \"codRecipient\": {\n" +
                "          \"address\": {\n" +
                "            \"streetLines\": [\n" +
                "              \"10 FedEx Parkway\",\n" +
                "              \"Suite 302\"\n" +
                "            ],\n" +
                "            \"city\": \"Beverly Hills\",\n" +
                "            \"stateOrProvinceCode\": \"CA\",\n" +
                "            \"postalCode\": \"90210\",\n" +
                "            \"countryCode\": \"US\",\n" +
                "            \"residential\": false\n" +
                "          },\n" +
                "          \"contact\": {\n" +
                "            \"personName\": \"John Taylor\",\n" +
                "            \"emailAddress\": \"sample@company.com\",\n" +
                "            \"phoneExtension\": \"000\",\n" +
                "            \"phoneNumber\": \"XXXX345671\",\n" +
                "            \"companyName\": \"Fedex\"\n" +
                "          },\n" +
                "          \"accountNumber\": {\n" +
                "            \"value\": \"Your account number\"\n" +
                "          },\n" +
                "          \"tins\": [\n" +
                "            {\n" +
                "              \"number\": \"123567\",\n" +
                "              \"tinType\": \"FEDERAL\",\n" +
                "              \"usage\": \"usage\",\n" +
                "              \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "              \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "            }\n" +
                "          ]\n" +
                "        },\n" +
                "        \"remitToName\": \"remitToName\",\n" +
                "        \"codCollectionType\": \"ANY\",\n" +
                "        \"financialInstitutionContactAndAddress\": {\n" +
                "          \"address\": {\n" +
                "            \"streetLines\": [\n" +
                "              \"10 FedEx Parkway\",\n" +
                "              \"Suite 302\"\n" +
                "            ],\n" +
                "            \"city\": \"Beverly Hills\",\n" +
                "            \"stateOrProvinceCode\": \"CA\",\n" +
                "            \"postalCode\": \"38127\",\n" +
                "            \"countryCode\": \"US\",\n" +
                "            \"residential\": false\n" +
                "          },\n" +
                "          \"contact\": {\n" +
                "            \"personName\": \"person name\",\n" +
                "            \"emailAddress\": \"email address\",\n" +
                "            \"phoneNumber\": \"phone number\",\n" +
                "            \"phoneExtension\": \"phone extension\",\n" +
                "            \"companyName\": \"company name\",\n" +
                "            \"faxNumber\": \"fax number\"\n" +
                "          }\n" +
                "        },\n" +
                "        \"codCollectionAmount\": {\n" +
                "          \"amount\": 12.45,\n" +
                "          \"currency\": \"USD\"\n" +
                "        },\n" +
                "        \"returnReferenceIndicatorType\": \"INVOICE\",\n" +
                "        \"shipmentCodAmount\": {\n" +
                "          \"amount\": 12.45,\n" +
                "          \"currency\": \"USD\"\n" +
                "        }\n" +
                "      },\n" +
                "      \"shipmentDryIceDetail\": {\n" +
                "        \"totalWeight\": {\n" +
                "          \"units\": \"LB\",\n" +
                "          \"value\": 10\n" +
                "        },\n" +
                "        \"packageCount\": 12\n" +
                "      },\n" +
                "      \"internationalControlledExportDetail\": {\n" +
                "        \"licenseOrPermitExpirationDate\": \"2019-12-03\",\n" +
                "        \"licenseOrPermitNumber\": \"11\",\n" +
                "        \"entryNumber\": \"125\",\n" +
                "        \"foreignTradeZoneCode\": \"US\",\n" +
                "        \"type\": \"WAREHOUSE_WITHDRAWAL\"\n" +
                "      },\n" +
                "      \"homeDeliveryPremiumDetail\": {\n" +
                "        \"phoneNumber\": {\n" +
                "          \"areaCode\": \"901\",\n" +
                "          \"localNumber\": \"3575012\",\n" +
                "          \"extension\": \"200\",\n" +
                "          \"personalIdentificationNumber\": \"98712345\"\n" +
                "        },\n" +
                "        \"deliveryDate\": \"2019-06-26\",\n" +
                "        \"homedeliveryPremiumType\": \"APPOINTMENT\"\n" +
                "      }\n" +
                "    },\n" +
                "    \"emailNotificationDetail\": {\n" +
                "      \"aggregationType\": \"PER_PACKAGE\",\n" +
                "      \"emailNotificationRecipients\": [\n" +
                "        {\n" +
                "          \"name\": \"Joe Smith\",\n" +
                "          \"emailNotificationRecipientType\": \"SHIPPER\",\n" +
                "          \"emailAddress\": \"jsmith3@aol.com\",\n" +
                "          \"notificationFormatType\": \"TEXT\",\n" +
                "          \"notificationType\": \"EMAIL\",\n" +
                "          \"locale\": \"en_US\",\n" +
                "          \"notificationEventType\": [\n" +
                "            \"ON_PICKUP_DRIVER_ARRIVED\",\n" +
                "            \"ON_SHIPMENT\"\n" +
                "          ]\n" +
                "        }\n" +
                "      ],\n" +
                "      \"personalMessage\": \"your personal message here\"\n" +
                "    },\n" +
                "    \"expressFreightDetail\": {\n" +
                "      \"bookingConfirmationNumber\": \"123456789812\",\n" +
                "      \"shippersLoadAndCount\": 123,\n" +
                "      \"packingListEnclosed\": true\n" +
                "    },\n" +
                "    \"variableHandlingChargeDetail\": {\n" +
                "      \"rateType\": \"PREFERRED_CURRENCY\",\n" +
                "      \"percentValue\": 12.45,\n" +
                "      \"rateLevelType\": \"INDIVIDUAL_PACKAGE_RATE\",\n" +
                "      \"fixedValue\": {\n" +
                "        \"amount\": 24.45,\n" +
                "        \"currency\": \"USD\"\n" +
                "      },\n" +
                "      \"rateElementBasis\": \"NET_CHARGE_EXCLUDING_TAXES\"\n" +
                "    },\n" +
                "    \"customsClearanceDetail\": {\n" +
                "      \"regulatoryControls\": \"NOT_IN_FREE_CIRCULATION\",\n" +
                "      \"brokers\": [\n" +
                "        {\n" +
                "          \"broker\": {\n" +
                "            \"address\": {\n" +
                "              \"streetLines\": [\n" +
                "                \"10 FedEx Parkway\",\n" +
                "                \"Suite 302\"\n" +
                "              ],\n" +
                "              \"city\": \"Beverly Hills\",\n" +
                "              \"stateOrProvinceCode\": \"CA\",\n" +
                "              \"postalCode\": \"90210\",\n" +
                "              \"countryCode\": \"US\",\n" +
                "              \"residential\": false\n" +
                "            },\n" +
                "            \"contact\": {\n" +
                "              \"personName\": \"John Taylor\",\n" +
                "              \"emailAddress\": \"sample@company.com\",\n" +
                "              \"phoneNumber\": \"1234567890\",\n" +
                "              \"phoneExtension\": 91,\n" +
                "              \"companyName\": \"Fedex\",\n" +
                "              \"faxNumber\": 1234567\n" +
                "            },\n" +
                "            \"accountNumber\": {\n" +
                "              \"value\": \"Your account number\"\n" +
                "            },\n" +
                "            \"tins\": [\n" +
                "              {\n" +
                "                \"number\": \"number\",\n" +
                "                \"tinType\": \"FEDERAL\",\n" +
                "                \"usage\": \"usage\",\n" +
                "                \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "                \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "              }\n" +
                "            ],\n" +
                "            \"deliveryInstructions\": \"deliveryInstructions\"\n" +
                "          },\n" +
                "          \"type\": \"IMPORT\"\n" +
                "        }\n" +
                "      ],\n" +
                "      \"commercialInvoice\": {\n" +
                "        \"originatorName\": \"originator Name\",\n" +
                "        \"comments\": [\n" +
                "          \"optional comments for the commercial invoice\"\n" +
                "        ],\n" +
                "        \"customerReferences\": [\n" +
                "          {\n" +
                "            \"customerReferenceType\": \"INVOICE_NUMBER\",\n" +
                "            \"value\": \"3686\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"taxesOrMiscellaneousCharge\": {\n" +
                "          \"amount\": 12.45,\n" +
                "          \"currency\": \"USD\"\n" +
                "        },\n" +
                "        \"taxesOrMiscellaneousChargeType\": \"COMMISSIONS\",\n" +
                "        \"freightCharge\": {\n" +
                "          \"amount\": 12.45,\n" +
                "          \"currency\": \"USD\"\n" +
                "        },\n" +
                "        \"packingCosts\": {\n" +
                "          \"amount\": 12.45,\n" +
                "          \"currency\": \"USD\"\n" +
                "        },\n" +
                "        \"handlingCosts\": {\n" +
                "          \"amount\": 12.45,\n" +
                "          \"currency\": \"USD\"\n" +
                "        },\n" +
                "        \"declarationStatement\": \"declarationStatement\",\n" +
                "        \"termsOfSale\": \"FCA\",\n" +
                "        \"specialInstructions\": \"specialInstructions\\\"\",\n" +
                "        \"shipmentPurpose\": \"REPAIR_AND_RETURN\",\n" +
                "        \"emailNotificationDetail\": {\n" +
                "          \"emailAddress\": \"neena@fedex.com\",\n" +
                "          \"type\": \"EMAILED\",\n" +
                "          \"recipientType\": \"SHIPPER\"\n" +
                "        }\n" +
                "      },\n" +
                "      \"freightOnValue\": \"OWN_RISK\",\n" +
                "      \"dutiesPayment\": {\n" +
                "        \"payor\": {\n" +
                "          \"responsibleParty\": {\n" +
                "            \"address\": {\n" +
                "              \"streetLines\": [\n" +
                "                \"10 FedEx Parkway\",\n" +
                "                \"Suite 302\"\n" +
                "              ],\n" +
                "              \"city\": \"Beverly Hills\",\n" +
                "              \"stateOrProvinceCode\": \"CA\",\n" +
                "              \"postalCode\": \"38127\",\n" +
                "              \"countryCode\": \"US\",\n" +
                "              \"residential\": false\n" +
                "            },\n" +
                "            \"contact\": {\n" +
                "              \"personName\": \"John Taylor\",\n" +
                "              \"emailAddress\": \"sample@company.com\",\n" +
                "              \"phoneNumber\": \"1234567890\",\n" +
                "              \"phoneExtension\": \"phone extension\",\n" +
                "              \"companyName\": \"Fedex\",\n" +
                "              \"faxNumber\": \"fax number\"\n" +
                "            },\n" +
                "            \"accountNumber\": {\n" +
                "              \"value\": \"Your account number\"\n" +
                "            },\n" +
                "            \"tins\": [\n" +
                "              {\n" +
                "                \"number\": \"number\",\n" +
                "                \"tinType\": \"FEDERAL\",\n" +
                "                \"usage\": \"usage\",\n" +
                "                \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "                \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "              },\n" +
                "              {\n" +
                "                \"number\": \"number\",\n" +
                "                \"tinType\": \"FEDERAL\",\n" +
                "                \"usage\": \"usage\",\n" +
                "                \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "                \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "              }\n" +
                "            ]\n" +
                "          }\n" +
                "        },\n" +
                "        \"billingDetails\": {\n" +
                "          \"billingCode\": \"billingCode\",\n" +
                "          \"billingType\": \"billingType\",\n" +
                "          \"aliasId\": \"aliasId\",\n" +
                "          \"accountNickname\": \"accountNickname\",\n" +
                "          \"accountNumber\": \"Your account number\",\n" +
                "          \"accountNumberCountryCode\": \"US\"\n" +
                "        },\n" +
                "        \"paymentType\": \"SENDER\"\n" +
                "      },\n" +
                "      \"commodities\": [\n" +
                "        {\n" +
                "          \"unitPrice\": {\n" +
                "            \"amount\": 12.45,\n" +
                "            \"currency\": \"USD\"\n" +
                "          },\n" +
                "          \"additionalMeasures\": [\n" +
                "            {\n" +
                "              \"quantity\": 12.45,\n" +
                "              \"units\": \"KG\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"numberOfPieces\": 12,\n" +
                "          \"quantity\": 125,\n" +
                "          \"quantityUnits\": \"Ea\",\n" +
                "          \"customsValue\": {\n" +
                "            \"amount\": \"1556.25\",\n" +
                "            \"currency\": \"USD\"\n" +
                "          },\n" +
                "          \"countryOfManufacture\": \"US\",\n" +
                "          \"cIMarksAndNumbers\": \"87123\",\n" +
                "          \"harmonizedCode\": \"0613\",\n" +
                "          \"description\": \"description\",\n" +
                "          \"name\": \"non-threaded rivets\",\n" +
                "          \"weight\": {\n" +
                "            \"units\": \"KG\",\n" +
                "            \"value\": 68\n" +
                "          },\n" +
                "          \"exportLicenseNumber\": \"26456\",\n" +
                "          \"exportLicenseExpirationDate\": \"2023-08-09T03:48:43Z\",\n" +
                "          \"partNumber\": \"167\",\n" +
                "          \"purpose\": \"BUSINESS\",\n" +
                "          \"usmcaDetail\": {\n" +
                "            \"originCriterion\": \"A\"\n" +
                "          }\n" +
                "        }\n" +
                "      ],\n" +
                "      \"isDocumentOnly\": true,\n" +
                "      \"recipientCustomsId\": {\n" +
                "        \"type\": \"PASSPORT\",\n" +
                "        \"value\": \"123\"\n" +
                "      },\n" +
                "      \"customsOption\": {\n" +
                "        \"description\": \"Description\",\n" +
                "        \"type\": \"COURTESY_RETURN_LABEL\"\n" +
                "      },\n" +
                "      \"importerOfRecord\": {\n" +
                "        \"address\": {\n" +
                "          \"streetLines\": [\n" +
                "            \"10 FedEx Parkway\",\n" +
                "            \"Suite 302\"\n" +
                "          ],\n" +
                "          \"city\": \"Beverly Hills\",\n" +
                "          \"stateOrProvinceCode\": \"CA\",\n" +
                "          \"postalCode\": \"90210\",\n" +
                "          \"countryCode\": \"US\",\n" +
                "          \"residential\": false\n" +
                "        },\n" +
                "        \"contact\": {\n" +
                "          \"personName\": \"John Taylor\",\n" +
                "          \"emailAddress\": \"sample@company.com\",\n" +
                "          \"phoneExtension\": \"000\",\n" +
                "          \"phoneNumber\": \"XXXX345671\",\n" +
                "          \"companyName\": \"Fedex\"\n" +
                "        },\n" +
                "        \"accountNumber\": {\n" +
                "          \"value\": \"Your account number\"\n" +
                "        },\n" +
                "        \"tins\": [\n" +
                "          {\n" +
                "            \"number\": \"123567\",\n" +
                "            \"tinType\": \"FEDERAL\",\n" +
                "            \"usage\": \"usage\",\n" +
                "            \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "            \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "          }\n" +
                "        ]\n" +
                "      },\n" +
                "      \"generatedDocumentLocale\": \"en_US\",\n" +
                "      \"exportDetail\": {\n" +
                "        \"destinationControlDetail\": {\n" +
                "          \"endUser\": \"dest country user\",\n" +
                "          \"statementTypes\": \"DEPARTMENT_OF_COMMERCE\",\n" +
                "          \"destinationCountries\": [\n" +
                "            \"USA\",\n" +
                "            \"India\"\n" +
                "          ]\n" +
                "        },\n" +
                "        \"b13AFilingOption\": \"NOT_REQUIRED\",\n" +
                "        \"exportComplianceStatement\": \"12345678901234567\",\n" +
                "        \"permitNumber\": \"12345\"\n" +
                "      },\n" +
                "      \"totalCustomsValue\": {\n" +
                "        \"amount\": 12.45,\n" +
                "        \"currency\": \"USD\"\n" +
                "      },\n" +
                "      \"partiesToTransactionAreRelated\": true,\n" +
                "      \"declarationStatementDetail\": {\n" +
                "        \"usmcaLowValueStatementDetail\": {\n" +
                "          \"countryOfOriginLowValueDocumentRequested\": true,\n" +
                "          \"customsRole\": \"EXPORTER\"\n" +
                "        }\n" +
                "      },\n" +
                "      \"insuranceCharge\": {\n" +
                "        \"amount\": 12.45,\n" +
                "        \"currency\": \"USD\"\n" +
                "      }\n" +
                "    },\n" +
                "    \"smartPostInfoDetail\": {\n" +
                "      \"ancillaryEndorsement\": \"RETURN_SERVICE\",\n" +
                "      \"hubId\": \"5015\",\n" +
                "      \"indicia\": \"PRESORTED_STANDARD\",\n" +
                "      \"specialServices\": \"USPS_DELIVERY_CONFIRMATION\"\n" +
                "    },\n" +
                "    \"blockInsightVisibility\": true,\n" +
                "    \"labelSpecification\": {\n" +
                "      \"labelFormatType\": \"COMMON2D\",\n" +
                "      \"labelOrder\": \"SHIPPING_LABEL_FIRST\",\n" +
                "      \"customerSpecifiedDetail\": {\n" +
                "        \"maskedData\": [\n" +
                "          \"CUSTOMS_VALUE\",\n" +
                "          \"TOTAL_WEIGHT\"\n" +
                "        ],\n" +
                "        \"regulatoryLabels\": [\n" +
                "          {\n" +
                "            \"generationOptions\": \"CONTENT_ON_SHIPPING_LABEL_ONLY\",\n" +
                "            \"type\": \"ALCOHOL_SHIPMENT_LABEL\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"additionalLabels\": [\n" +
                "          {\n" +
                "            \"type\": \"CONSIGNEE\",\n" +
                "            \"count\": 1\n" +
                "          }\n" +
                "        ],\n" +
                "        \"docTabContent\": {\n" +
                "          \"docTabContentType\": \"BARCODED\",\n" +
                "          \"zone001\": {\n" +
                "            \"docTabZoneSpecifications\": [\n" +
                "              {\n" +
                "                \"zoneNumber\": 0,\n" +
                "                \"header\": \"string\",\n" +
                "                \"dataField\": \"string\",\n" +
                "                \"literalValue\": \"string\",\n" +
                "                \"justification\": \"RIGHT\"\n" +
                "              }\n" +
                "            ]\n" +
                "          },\n" +
                "          \"barcoded\": {\n" +
                "            \"symbology\": \"UCC128\",\n" +
                "            \"specification\": {\n" +
                "              \"zoneNumber\": 0,\n" +
                "              \"header\": \"string\",\n" +
                "              \"dataField\": \"string\",\n" +
                "              \"literalValue\": \"string\",\n" +
                "              \"justification\": \"RIGHT\"\n" +
                "            }\n" +
                "          }\n" +
                "        }\n" +
                "      },\n" +
                "      \"printedLabelOrigin\": {\n" +
                "        \"address\": {\n" +
                "          \"streetLines\": [\n" +
                "            \"10 FedEx Parkway\",\n" +
                "            \"Suite 302\"\n" +
                "          ],\n" +
                "          \"city\": \"Beverly Hills\",\n" +
                "          \"stateOrProvinceCode\": \"CA\",\n" +
                "          \"postalCode\": \"38127\",\n" +
                "          \"countryCode\": \"US\",\n" +
                "          \"residential\": false\n" +
                "        },\n" +
                "        \"contact\": {\n" +
                "          \"personName\": \"person name\",\n" +
                "          \"emailAddress\": \"email address\",\n" +
                "          \"phoneNumber\": \"phone number\",\n" +
                "          \"phoneExtension\": \"phone extension\",\n" +
                "          \"companyName\": \"company name\",\n" +
                "          \"faxNumber\": \"fax number\"\n" +
                "        }\n" +
                "      },\n" +
                "      \"labelStockType\": \"PAPER_85X11_TOP_HALF_LABEL\",\n" +
                "      \"labelRotation\": \"UPSIDE_DOWN\",\n" +
                "      \"imageType\": \"PDF\",\n" +
                "      \"labelPrintingOrientation\": \"TOP_EDGE_OF_TEXT_FIRST\",\n" +
                "      \"returnedDispositionDetail\": true\n" +
                "    },\n" +
                "    \"shippingDocumentSpecification\": {\n" +
                "      \"generalAgencyAgreementDetail\": {\n" +
                "        \"documentFormat\": {\n" +
                "          \"provideInstructions\": true,\n" +
                "          \"optionsRequested\": {\n" +
                "            \"options\": [\n" +
                "              \"SUPPRESS_ADDITIONAL_LANGUAGES\",\n" +
                "              \"SHIPPING_LABEL_LAST\"\n" +
                "            ]\n" +
                "          },\n" +
                "          \"stockType\": \"PAPER_LETTER\",\n" +
                "          \"dispositions\": [\n" +
                "            {\n" +
                "              \"eMailDetail\": {\n" +
                "                \"eMailRecipients\": [\n" +
                "                  {\n" +
                "                    \"emailAddress\": \"email@fedex.com\",\n" +
                "                    \"recipientType\": \"THIRD_PARTY\"\n" +
                "                  }\n" +
                "                ],\n" +
                "                \"locale\": \"en_US\",\n" +
                "                \"grouping\": \"NONE\"\n" +
                "              },\n" +
                "              \"dispositionType\": \"CONFIRMED\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"locale\": \"en_US\",\n" +
                "          \"docType\": \"PDF\"\n" +
                "        }\n" +
                "      },\n" +
                "      \"returnInstructionsDetail\": {\n" +
                "        \"customText\": \"This is additional text printed on Return instr\",\n" +
                "        \"documentFormat\": {\n" +
                "          \"provideInstructions\": true,\n" +
                "          \"optionsRequested\": {\n" +
                "            \"options\": [\n" +
                "              \"SUPPRESS_ADDITIONAL_LANGUAGES\",\n" +
                "              \"SHIPPING_LABEL_LAST\"\n" +
                "            ]\n" +
                "          },\n" +
                "          \"stockType\": \"PAPER_LETTER\",\n" +
                "          \"dispositions\": [\n" +
                "            {\n" +
                "              \"eMailDetail\": {\n" +
                "                \"eMailRecipients\": [\n" +
                "                  {\n" +
                "                    \"emailAddress\": \"email@fedex.com\",\n" +
                "                    \"recipientType\": \"THIRD_PARTY\"\n" +
                "                  }\n" +
                "                ],\n" +
                "                \"locale\": \"en_US\",\n" +
                "                \"grouping\": \"NONE\"\n" +
                "              },\n" +
                "              \"dispositionType\": \"CONFIRMED\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"locale\": \"en_US\\\"\",\n" +
                "          \"docType\": \"PNG\"\n" +
                "        }\n" +
                "      },\n" +
                "      \"op900Detail\": {\n" +
                "        \"customerImageUsages\": [\n" +
                "          {\n" +
                "            \"id\": \"IMAGE_5\",\n" +
                "            \"type\": \"SIGNATURE\",\n" +
                "            \"providedImageType\": \"SIGNATURE\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"signatureName\": \"Signature Name\",\n" +
                "        \"documentFormat\": {\n" +
                "          \"provideInstructions\": true,\n" +
                "          \"optionsRequested\": {\n" +
                "            \"options\": [\n" +
                "              \"SUPPRESS_ADDITIONAL_LANGUAGES\",\n" +
                "              \"SHIPPING_LABEL_LAST\"\n" +
                "            ]\n" +
                "          },\n" +
                "          \"stockType\": \"PAPER_LETTER\",\n" +
                "          \"dispositions\": [\n" +
                "            {\n" +
                "              \"eMailDetail\": {\n" +
                "                \"eMailRecipients\": [\n" +
                "                  {\n" +
                "                    \"emailAddress\": \"email@fedex.com\",\n" +
                "                    \"recipientType\": \"THIRD_PARTY\"\n" +
                "                  }\n" +
                "                ],\n" +
                "                \"locale\": \"en_US\",\n" +
                "                \"grouping\": \"NONE\"\n" +
                "              },\n" +
                "              \"dispositionType\": \"CONFIRMED\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"locale\": \"en_US\",\n" +
                "          \"docType\": \"PDF\"\n" +
                "        }\n" +
                "      },\n" +
                "      \"usmcaCertificationOfOriginDetail\": {\n" +
                "        \"customerImageUsages\": [\n" +
                "          {\n" +
                "            \"id\": \"IMAGE_5\",\n" +
                "            \"type\": \"SIGNATURE\",\n" +
                "            \"providedImageType\": \"SIGNATURE\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"documentFormat\": {\n" +
                "          \"provideInstructions\": true,\n" +
                "          \"optionsRequested\": {\n" +
                "            \"options\": [\n" +
                "              \"SUPPRESS_ADDITIONAL_LANGUAGES\",\n" +
                "              \"SHIPPING_LABEL_LAST\"\n" +
                "            ]\n" +
                "          },\n" +
                "          \"stockType\": \"PAPER_LETTER\",\n" +
                "          \"dispositions\": [\n" +
                "            {\n" +
                "              \"eMailDetail\": {\n" +
                "                \"eMailRecipients\": [\n" +
                "                  {\n" +
                "                    \"emailAddress\": \"email@fedex.com\",\n" +
                "                    \"recipientType\": \"THIRD_PARTY\"\n" +
                "                  }\n" +
                "                ],\n" +
                "                \"locale\": \"en_US\",\n" +
                "                \"grouping\": \"NONE\"\n" +
                "              },\n" +
                "              \"dispositionType\": \"CONFIRMED\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"locale\": \"en_US\",\n" +
                "          \"docType\": \"PDF\"\n" +
                "        },\n" +
                "        \"certifierSpecification\": \"EXPORTER\",\n" +
                "        \"importerSpecification\": \"UNKNOWN\",\n" +
                "        \"producerSpecification\": \"SAME_AS_EXPORTER\",\n" +
                "        \"producer\": {\n" +
                "          \"address\": {\n" +
                "            \"streetLines\": [\n" +
                "              \"10 FedEx Parkway\",\n" +
                "              \"Suite 302\"\n" +
                "            ],\n" +
                "            \"city\": \"Beverly Hills\",\n" +
                "            \"stateOrProvinceCode\": \"CA\",\n" +
                "            \"postalCode\": \"90210\",\n" +
                "            \"countryCode\": \"US\",\n" +
                "            \"residential\": false\n" +
                "          },\n" +
                "          \"contact\": {\n" +
                "            \"personName\": \"John Taylor\",\n" +
                "            \"emailAddress\": \"sample@company.com\",\n" +
                "            \"phoneExtension\": \"000\",\n" +
                "            \"phoneNumber\": \"XXXX345671\",\n" +
                "            \"companyName\": \"Fedex\"\n" +
                "          },\n" +
                "          \"accountNumber\": {\n" +
                "            \"value\": \"Your account number\"\n" +
                "          },\n" +
                "          \"tins\": [\n" +
                "            {\n" +
                "              \"number\": \"123567\",\n" +
                "              \"tinType\": \"FEDERAL\",\n" +
                "              \"usage\": \"usage\",\n" +
                "              \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "              \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "            }\n" +
                "          ]\n" +
                "        },\n" +
                "        \"blanketPeriod\": {\n" +
                "          \"begins\": \"22-01-2020\",\n" +
                "          \"ends\": \"2-01-2020\"\n" +
                "        },\n" +
                "        \"certifierJobTitle\": \"Manager\"\n" +
                "      },\n" +
                "      \"usmcaCommercialInvoiceCertificationOfOriginDetail\": {\n" +
                "        \"customerImageUsages\": [\n" +
                "          {\n" +
                "            \"id\": \"IMAGE_5\",\n" +
                "            \"type\": \"SIGNATURE\",\n" +
                "            \"providedImageType\": \"SIGNATURE\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"documentFormat\": {\n" +
                "          \"provideInstructions\": true,\n" +
                "          \"optionsRequested\": {\n" +
                "            \"options\": [\n" +
                "              \"SUPPRESS_ADDITIONAL_LANGUAGES\",\n" +
                "              \"SHIPPING_LABEL_LAST\"\n" +
                "            ]\n" +
                "          },\n" +
                "          \"stockType\": \"PAPER_LETTER\",\n" +
                "          \"dispositions\": [\n" +
                "            {\n" +
                "              \"eMailDetail\": {\n" +
                "                \"eMailRecipients\": [\n" +
                "                  {\n" +
                "                    \"emailAddress\": \"email@fedex.com\",\n" +
                "                    \"recipientType\": \"THIRD_PARTY\"\n" +
                "                  }\n" +
                "                ],\n" +
                "                \"locale\": \"en_US\",\n" +
                "                \"grouping\": \"NONE\"\n" +
                "              },\n" +
                "              \"dispositionType\": \"CONFIRMED\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"locale\": \"en_US\",\n" +
                "          \"docType\": \"PDF\"\n" +
                "        },\n" +
                "        \"certifierSpecification\": \"EXPORTER\",\n" +
                "        \"importerSpecification\": \"UNKNOWN\",\n" +
                "        \"producerSpecification\": \"SAME_AS_EXPORTER\",\n" +
                "        \"producer\": {\n" +
                "          \"address\": {\n" +
                "            \"streetLines\": [\n" +
                "              \"10 FedEx Parkway\",\n" +
                "              \"Suite 302\"\n" +
                "            ],\n" +
                "            \"city\": \"Beverly Hills\",\n" +
                "            \"stateOrProvinceCode\": \"CA\",\n" +
                "            \"postalCode\": \"90210\",\n" +
                "            \"countryCode\": \"US\",\n" +
                "            \"residential\": false\n" +
                "          },\n" +
                "          \"contact\": {\n" +
                "            \"personName\": \"John Taylor\",\n" +
                "            \"emailAddress\": \"sample@company.com\",\n" +
                "            \"phoneExtension\": \"000\",\n" +
                "            \"phoneNumber\": \"XXXX345671\",\n" +
                "            \"companyName\": \"Fedex\"\n" +
                "          },\n" +
                "          \"accountNumber\": {\n" +
                "            \"value\": \"Your account number\"\n" +
                "          },\n" +
                "          \"tins\": [\n" +
                "            {\n" +
                "              \"number\": \"123567\",\n" +
                "              \"tinType\": \"FEDERAL\",\n" +
                "              \"usage\": \"usage\",\n" +
                "              \"effectiveDate\": \"2000-01-23T04:56:07.000+00:00\",\n" +
                "              \"expirationDate\": \"2000-01-23T04:56:07.000+00:00\"\n" +
                "            }\n" +
                "          ]\n" +
                "        },\n" +
                "        \"certifierJobTitle\": \"Manager\"\n" +
                "      },\n" +
                "      \"shippingDocumentTypes\": [\n" +
                "        \"RETURN_INSTRUCTIONS\"\n" +
                "      ],\n" +
                "      \"certificateOfOrigin\": {\n" +
                "        \"customerImageUsages\": [\n" +
                "          {\n" +
                "            \"id\": \"IMAGE_5\",\n" +
                "            \"type\": \"SIGNATURE\",\n" +
                "            \"providedImageType\": \"SIGNATURE\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"documentFormat\": {\n" +
                "          \"provideInstructions\": true,\n" +
                "          \"optionsRequested\": {\n" +
                "            \"options\": [\n" +
                "              \"SUPPRESS_ADDITIONAL_LANGUAGES\",\n" +
                "              \"SHIPPING_LABEL_LAST\"\n" +
                "            ]\n" +
                "          },\n" +
                "          \"stockType\": \"PAPER_LETTER\",\n" +
                "          \"dispositions\": [\n" +
                "            {\n" +
                "              \"eMailDetail\": {\n" +
                "                \"eMailRecipients\": [\n" +
                "                  {\n" +
                "                    \"emailAddress\": \"email@fedex.com\",\n" +
                "                    \"recipientType\": \"THIRD_PARTY\"\n" +
                "                  }\n" +
                "                ],\n" +
                "                \"locale\": \"en_US\",\n" +
                "                \"grouping\": \"NONE\"\n" +
                "              },\n" +
                "              \"dispositionType\": \"CONFIRMED\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"locale\": \"en_US\",\n" +
                "          \"docType\": \"PDF\"\n" +
                "        }\n" +
                "      },\n" +
                "      \"commercialInvoiceDetail\": {\n" +
                "        \"customerImageUsages\": [\n" +
                "          {\n" +
                "            \"id\": \"IMAGE_5\",\n" +
                "            \"type\": \"SIGNATURE\",\n" +
                "            \"providedImageType\": \"SIGNATURE\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"documentFormat\": {\n" +
                "          \"provideInstructions\": true,\n" +
                "          \"optionsRequested\": {\n" +
                "            \"options\": [\n" +
                "              \"SUPPRESS_ADDITIONAL_LANGUAGES\",\n" +
                "              \"SHIPPING_LABEL_LAST\"\n" +
                "            ]\n" +
                "          },\n" +
                "          \"stockType\": \"PAPER_LETTER\",\n" +
                "          \"dispositions\": [\n" +
                "            {\n" +
                "              \"eMailDetail\": {\n" +
                "                \"eMailRecipients\": [\n" +
                "                  {\n" +
                "                    \"emailAddress\": \"email@fedex.com\",\n" +
                "                    \"recipientType\": \"THIRD_PARTY\"\n" +
                "                  }\n" +
                "                ],\n" +
                "                \"locale\": \"en_US\",\n" +
                "                \"grouping\": \"NONE\"\n" +
                "              },\n" +
                "              \"dispositionType\": \"CONFIRMED\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"locale\": \"en_US\",\n" +
                "          \"docType\": \"PDF\"\n" +
                "        }\n" +
                "      }\n" +
                "    },\n" +
                "    \"rateRequestType\": [\n" +
                "      \"LIST\",\n" +
                "      \"PREFERRED\"\n" +
                "    ],\n" +
                "    \"preferredCurrency\": \"USD\",\n" +
                "    \"totalPackageCount\": 25,\n" +
                "    \"masterTrackingId\": {\n" +
                "      \"formId\": \"0201\",\n" +
                "      \"trackingIdType\": \"EXPRESS\",\n" +
                "      \"uspsApplicationId\": \"92\",\n" +
                "      \"trackingNumber\": \"49092000070120032835\"\n" +
                "    },\n" +
                "    \"requestedPackageLineItems\": [\n" +
                "      {\n" +
                "        \"sequenceNumber\": \"1\",\n" +
                "        \"subPackagingType\": \"BUCKET\",\n" +
                "        \"customerReferences\": [\n" +
                "          {\n" +
                "            \"customerReferenceType\": \"INVOICE_NUMBER\",\n" +
                "            \"value\": \"3686\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"declaredValue\": {\n" +
                "          \"amount\": 12.45,\n" +
                "          \"currency\": \"USD\"\n" +
                "        },\n" +
                "        \"weight\": {\n" +
                "          \"units\": \"KG\",\n" +
                "          \"value\": 68\n" +
                "        },\n" +
                "        \"dimensions\": {\n" +
                "          \"length\": 100,\n" +
                "          \"width\": 50,\n" +
                "          \"height\": 30,\n" +
                "          \"units\": \"CM\"\n" +
                "        },\n" +
                "        \"groupPackageCount\": 2,\n" +
                "        \"itemDescriptionForClearance\": \"description\",\n" +
                "        \"contentRecord\": [\n" +
                "          {\n" +
                "            \"itemNumber\": \"2876\",\n" +
                "            \"receivedQuantity\": 256,\n" +
                "            \"description\": \"Description\",\n" +
                "            \"partNumber\": \"456\"\n" +
                "          }\n" +
                "        ],\n" +
                "        \"itemDescription\": \"item description for the package\",\n" +
                "        \"variableHandlingChargeDetail\": {\n" +
                "          \"rateType\": \"PREFERRED_CURRENCY\",\n" +
                "          \"percentValue\": 12.45,\n" +
                "          \"rateLevelType\": \"INDIVIDUAL_PACKAGE_RATE\",\n" +
                "          \"fixedValue\": {\n" +
                "            \"amount\": 24.45,\n" +
                "            \"currency\": \"USD\"\n" +
                "          },\n" +
                "          \"rateElementBasis\": \"NET_CHARGE_EXCLUDING_TAXES\"\n" +
                "        },\n" +
                "        \"packageSpecialServices\": {\n" +
                "          \"specialServiceTypes\": [\n" +
                "            \"ALCOHOL\",\n" +
                "            \"NON_STANDARD_CONTAINER\"\n" +
                "          ],\n" +
                "          \"signatureOptionType\": \"ADULT\",\n" +
                "          \"priorityAlertDetail\": {\n" +
                "            \"enhancementTypes\": [\n" +
                "              \"PRIORITY_ALERT_PLUS\"\n" +
                "            ],\n" +
                "            \"content\": [\n" +
                "              \"string\"\n" +
                "            ]\n" +
                "          },\n" +
                "          \"signatureOptionDetail\": {\n" +
                "            \"signatureReleaseNumber\": \"23456\"\n" +
                "          },\n" +
                "          \"alcoholDetail\": {\n" +
                "            \"alcoholRecipientType\": \"LICENSEE\",\n" +
                "            \"shipperAgreementType\": \"Retailer\"\n" +
                "          },\n" +
                "          \"dangerousGoodsDetail\": {\n" +
                "            \"cargoAircraftOnly\": false,\n" +
                "            \"accessibility\": \"INACCESSIBLE\",\n" +
                "            \"options\": [\n" +
                "              \"LIMITED_QUANTITIES_COMMODITIES\",\n" +
                "              \"ORM_D\"\n" +
                "            ]\n" +
                "          },\n" +
                "          \"packageCODDetail\": {\n" +
                "            \"codCollectionAmount\": {\n" +
                "              \"amount\": 12.45,\n" +
                "              \"currency\": \"USD\"\n" +
                "            }\n" +
                "          },\n" +
                "          \"pieceCountVerificationBoxCount\": 0,\n" +
                "          \"batteryDetails\": [\n" +
                "            {\n" +
                "              \"batteryPackingType\": \"CONTAINED_IN_EQUIPMENT\",\n" +
                "              \"batteryRegulatoryType\": \"IATA_SECTION_II\",\n" +
                "              \"batteryMaterialType\": \"LITHIUM_METAL\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"dryIceWeight\": {\n" +
                "            \"units\": \"KG\",\n" +
                "            \"value\": 68\n" +
                "          }\n" +
                "        },\n" +
                "        \"trackingNumber\": \"756477399\"\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  \"labelResponseOptions\": \"LABEL\",\n" +
                "  \"accountNumber\": {\n" +
                "    \"value\": \"Your account number\"\n" +
                "  },\n" +
                "  \"shipAction\": \"CONFIRM\",\n" +
                "  \"processingOptionType\": \"ALLOW_ASYNCHRONOUS\",\n" +
                "  \"oneLabelAtATime\": true\n" +
                "}";
        JSONObject object= JSONObject.parseObject(json);
        System.out.println(object);
        CloseableHttpResponse response1 = null;
        CloseableHttpClient httpclient = HttpClients.createDefault();
        List<NameValuePair> paramList = new ArrayList<>();
        String url="https://apis-sandbox.fedex.com/ship/v1/shipments/results";
        HttpPost httpPost = new HttpPost(url);
        httpPost.setEntity(new StringEntity(object.toJSONString(), StandardCharsets.UTF_8));
        httpPost.setHeader("Content-type","application/json");
        httpPost.setHeader("X-locale", "zh_CN");
        String token="m-jIWUwIq9Vsj0no9K18aV9ij3I-JcA3flrrSoym0cNpy1uyt9SH2BY8gnrh3U__W6Snp2r7TyoXD4LBszXBGbXdxYaXnGiOMqXSOkzl7bzEv8ocSe6ZMxvW9IpYFoe4v7ZzWvnLcH40SdsQ5Klaqwsrk0mPFikXEXTXtpkug4GGUVwV1NY50qkjguztlmHjuieKDTZ2cuv4ea_I2U8aO2abVLoNo_chR0OZY6RE4fyXiDctPLH7QWfTGsf0TdBVH9v2jLP77VwKDru-0aSj1nG1F7O-ICL8xh65HpATkA0AqNbvUkjkDmTZVmcT4mIQ9Ohigyfk2HDE9z3dZaq4097ctiliY1mLcbWrPfuShg9JImqtxBYJ7QaxywBZNMtAgNDAw19-o5OLuMWCow07QQtOCiuyl2Np6P1UgPAexQu9UqqnVjeTdT_nz-oJBbpqt_Or3Mtj7S_ckeILiNIEiVCHaIzvrdg7XGOt0HB7mdugPkVE2DguNzTdqgb7_ZXCQ";
        token="Bearer "+token;
        System.out.println(token);
        httpPost.setHeader("Authorization", token);
        response1 = httpclient.execute(httpPost);

        HttpEntity entity = response1.getEntity();
        if (entity != null) {
            //按指定编码转换结果实体为String类型
            String body = EntityUtils.toString(entity, "UTF-8");
            JSONObject jsonresult= JSONObject.parseObject(body);
            System.out.println(jsonresult);
            //System.out.println(body);

        }


    }

    @Test
    public void fedex_token_test() throws IOException {
        CloseableHttpResponse response1 = null;
        CloseableHttpClient httpclient = HttpClients.createDefault();
        List<NameValuePair> paramList = new ArrayList<>();
        String url="https://apis-sandbox.fedex.com";
        String apikey="l7886c3600eea54db1bdfa17a8b673d864";
        String secrectkey="d22b77ad03494beca91ec389a3698986";
        paramList.add(new BasicNameValuePair("grant_type","client_credentials"));
        paramList.add(new BasicNameValuePair("client_id",apikey));
        paramList.add(new BasicNameValuePair("client_secret",secrectkey));
        HttpPost httpPost = new HttpPost(url+"/oauth/token");
        System.out.println(paramList);
        httpPost.setEntity(new UrlEncodedFormEntity(paramList, "UTF-8"));

        //httpPost.setEntity(new StringEntity(paramList, StandardCharsets.UTF_8));
        //httpPost.setHeader("Content-Type", "application/text;charset=utf8");
        httpPost.setHeader("Content-type", "application/x-www-form-urlencoded");


        //httpPost.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
        response1 = httpclient.execute(httpPost);

        HttpEntity entity = response1.getEntity();
        if (entity != null) {
            //按指定编码转换结果实体为String类型
            String body = EntityUtils.toString(entity, "UTF-8");
            JSONObject jsonresult= JSONObject.parseObject(body);
            System.out.println(jsonresult);
            //System.out.println(body);

        }


    }
    @Test
    public void fedex_token() throws IOException {
        //CloseableHttpResponse response1 = null;
        //CloseableHttpClient httpclient = HttpClients.createDefault();
        OkHttpClient client = new OkHttpClient();


        String url="https://apis-sandbox.fedex.com";
        String apikey="l7886c3600eea54db1bdfa17a8b673d864";
        String secrectkey="d22b77ad03494beca91ec389a3698986";
        JSONObject object = new JSONObject();
        object.put("grant_type","client_credentials");
        object.put("client_id",apikey);
        object.put("client_secret",secrectkey);
       // HttpPost httpPost = new HttpPost(url+"/oauth/token");
        String str="" ;
        StringBuffer list=new StringBuffer();
        list.append("grant_type=client_credentials&");
        list.append("client_id="+apikey+"&");
        list.append("client_secret="+secrectkey);
        System.out.println(list.toString());
        MediaType mediaType = MediaType.parse("application/json");
// 'input' refers to JSON Payload
        RequestBody body = RequestBody.create(mediaType, list.toString());
        Request request = new Request.Builder()
                .url("https://apis-sandbox.fedex.com/oauth/token")
                .post(body)
                .addHeader("Content-Type", "application/x-www-form-urlencoded")
                .build();

        Response response = client.newCall(request).execute();
        //if (!response.isSuccessful()) throw new IIOException("Unexpected code"+response);
        String responsedate=response.body().string();
        System.out.println(responsedate);

//        if (entity != null) {
//            //按指定编码转换结果实体为String类型
//            String body = EntityUtils.toString(entity, "UTF-8");
//            System.out.println(body);
//
//        }

       // httpPost.setEntity(new StringEntity(object.toJSONString(), StandardCharsets.UTF_8));
        //httpPost.setHeader("Content-Type", "application/text;charset=utf8");
        //httpPost.setHeader("Content-type", "application/json");
//        httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
//
//
//        //httpPost.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
//        response1 = httpclient.execute(httpPost);
//
//        HttpEntity entity = response1.getEntity();
//        if (entity != null) {
//            //按指定编码转换结果实体为String类型
//            String body = EntityUtils.toString(entity, "UTF-8");
//            System.out.println(body);
//
//        }




    }
    @Test
    public void get_menu_test() throws Exception {


        String url="http://localhost:8020/service-flow/api/getMenu";
        //String url="http://localhost:8090/QianchengAPI/API/SendToSpdb/ordLndStQry";
//        JSONObject object = new JSONObject();
//
//
//
//        HttpPost httpPost = new HttpPost(url);
//        String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IkxPSUUiLCJleHAiOjE2ODQ2Njg2NTQsInVzZXIiOiJhZG1pbiIsImlhdCI6MTY4NDY1MDY1NH0.YJknwpiOl6mRS7ZYKiEuYqNwdzMRRcGsAebxyL_adKE";
        String msg="{\"user\":\"\",\"name\":\"\",\"flag\":1,\"dataAuthority\":\"\",\"roleId\":\"\",\"pageSize\":9,\"pageIndex\":0}";
        String key=Tokentime.secretKey;
        System.out.println(Tokentime.secretKey);
        //String mwMsg = SecureUtil.encryptAES(msg, key);
       // System.out.println(mwMsg);
//        httpPost.setEntity(new StringEntity(mwMsg, StandardCharsets.UTF_8));
//
//        //String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IkxPSUUiLCJleHAiOjE2ODQwMDc0MTQsInVzZXIiOiJhZG1pbiIsImlhdCI6MTY4Mzk4OTQxNH0._LYWBPBqfBYYpDuJ4d1HQK6dAvavkuLLUhT4sSBeBCc";
//        //httpPost.setHeader("Content-Type", "application/text;charset=utf8");
////        httpPost.setHeader("Authorization",token);
//        httpPost.setHeader("Authorization",token);
//        httpPost.setHeader("Content-type", "application/json");
//
//
//
//
//        //httpPost.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
//        response1 = httpclient.execute(httpPost);
//        System.out.println("response1"+response1);
//
//        HttpEntity entity = response1.getEntity();
//        if (entity != null) {
//            //按指定编码转换结果实体为String类型
//            String body = EntityUtils.toString(entity, "UTF-8");
//            JSONObject json1=JSON.parseObject(body);
//
//            System.out.println(body);
//            mwMsg = SecureUtil.decryptAES(json1.getString("data"), key);
//            System.out.println(mwMsg);
//
//
//        }
//

    }


    @Test
    public void http_post_test() throws Exception {
        //CloseableHttpResponse response1 = null;
       // CloseableHttpClient httpclient = HttpClients.createDefault();


        //String url="http://localhost:9200/DataCenter/api/login";
//        String url="http://localhost:8005/service-msm/api/login";
        //String url="http://localhost:8090/QianchengAPI/API/SendToSpdb/ordLndStQry";
        String url="http://localhost:8020/service-flow/api/login";
        String username="admin";
        String password="123456";
        TokenInfoBO tokenInfoBO= Gettoken.get_token(url,username,password);
        System.out.println(tokenInfoBO);
        Tokentime.token=tokenInfoBO.getToken();
        Tokentime.publickey=tokenInfoBO.getPublickey();
        if (!Strings.isEmpty(tokenInfoBO.getToken())){
        HashMap<String, String> headers = new HashMap<>();
        headers.put("Authorization",Tokentime.token);
        headers.put("Content-type","application/json");

        url="http://localhost:8020/service-flow/api/setAES";
        String uuid = UUID.randomUUID().toString().toUpperCase().replaceAll("-","");
        Tokentime.secretKey=uuid;
        ParamBO bo=new ParamBO();
            String resJiami= RsaUtil.encryptRSA(uuid, Tokentime.publickey);

            bo.setSecretKey(resJiami);


            String jsonString = JSON.toJSONString(bo);
            //System.out.println(Tokentime.token);
            //System.out.println(Tokentime.secretKey);
             url="http://localhost:8020/service-flow/api/getMenu";
//        bo.setSecretKey(uuid);
//            System.out.println(uuid);
// 构建请求体


// 发送POST JSON请求
        String response = HttpUtil.httpPostJson(url,headers, jsonString,  false);
        String msg="{\"user\":\"\",\"name\":\"\",\"flag\":1,\"dataAuthority\":\"\",\"roleId\":\"\",\"pageSize\":9,\"pageIndex\":0}";
        String mwMsg = SecureUtil.encryptAES(msg, Tokentime.secretKey);
        response = HttpUtil.httpPostJson(url,headers, mwMsg,  false);
            JSONObject json1=JSON.parseObject(response);
//
            System.out.println(response);
            mwMsg = SecureUtil.decryptAES(json1.getString("data"), Tokentime.secretKey);
            System.out.println(mwMsg);
        }


//        JSONObject object = new JSONObject();
//        LoginBO bo=new LoginBO();
//        bo.setUserName("admin");
//        //2023-05-10 23:48:51loie_api25D55AD283AA400AF464C76D713C07AD
//        bo.setLoginDate("2023-10-01 19:48:51");
//        String password="123456";
//        password=SecureUtil.MD5Encode(password);
//
//        String comparePasswd = bo.getLoginDate() + SLAT + password;
//        comparePasswd=SecureUtil.MD5Encode(comparePasswd);
//        bo.setPassword(comparePasswd);
//        String jsonString = JSON.toJSONString(bo);
//
//        System.out.println(jsonString);
//        HttpPost httpPost = new HttpPost(url);
//
//        httpPost.setEntity(new StringEntity(jsonString, StandardCharsets.UTF_8));
//        //httpPost.setHeader("Content-Type", "application/text;charset=utf8");
//        httpPost.setHeader("Content-type", "application/json");
//
//
//        //httpPost.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
//        response1 = httpclient.execute(httpPost);
//
//        HttpEntity entity = response1.getEntity();
//        if (entity != null) {
//            //按指定编码转换结果实体为String类型
//            String body = EntityUtils.toString(entity, "UTF-8");
//            System.out.println(body);
//
//        }


    }

    @Test
    public void http_post_setae() throws Exception {
        CloseableHttpResponse response1 = null;
        CloseableHttpClient httpclient = HttpClients.createDefault();


        //String url="http://localhost:9200/api/setAES";

        String url="http://localhost:8020/service-flow/api/setAES";
        //String url="http://localhost:8090/QianchengAPI/API/SendToSpdb/ordLndStQry";
        JSONObject object = new JSONObject();
        ParamBO bo=new ParamBO();
        String str= UUID.randomUUID().toString().replace("-","");
        //System.out.println(str);
        String publickey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJyptLm7VJs+xdQ0wT0byq/7wO2OyBpzJOER5b\r\nNkY0CA5i7YM6K2qkRWVL0OV6sbdYTo2e2+6bSM3Box0/1a6iKZajPXT0dUdvCzPIr9AUZfFrM35G\r\nsHNPZeQG3a0Ho2WN2pw07jOtWeE/maP79oSYg9q/tNbUgPMbg2oMHA4D6QIDAQAB\r\n";

        String resJiami= RsaUtil.encryptRSA(str, publickey);

        bo.setSecretKey(resJiami);


        String jsonString = JSON.toJSONString(bo);
        System.out.println(jsonString);


        HttpPost httpPost = new HttpPost(url);
        String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IkxPSUUiLCJleHAiOjE2ODQ2Njg2NTQsInVzZXIiOiJhZG1pbiIsImlhdCI6MTY4NDY1MDY1NH0.YJknwpiOl6mRS7ZYKiEuYqNwdzMRRcGsAebxyL_adKE";

        httpPost.setEntity(new StringEntity(jsonString, StandardCharsets.UTF_8));

        //String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IkxPSUUiLCJleHAiOjE2ODQwMDc0MTQsInVzZXIiOiJhZG1pbiIsImlhdCI6MTY4Mzk4OTQxNH0._LYWBPBqfBYYpDuJ4d1HQK6dAvavkuLLUhT4sSBeBCc";
        //httpPost.setHeader("Content-Type", "application/text;charset=utf8");
//        httpPost.setHeader("Authorization",token);
        httpPost.setHeader("Authorization",token);
        httpPost.setHeader("Content-type", "application/json");




        //httpPost.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
        response1 = httpclient.execute(httpPost);
        System.out.println("response1"+response1);

        HttpEntity entity = response1.getEntity();
        if (entity != null) {
            //按指定编码转换结果实体为String类型
            String body = EntityUtils.toString(entity, "UTF-8");
            System.out.println(body);

        }


    }
    @Test public void getprivatekey(){
        String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IkxPSUUiLCJleHAiOjE2ODQwODAzMzQsInVzZXIiOiJhZG1pbiIsImlhdCI6MTY4NDA2MjMzNH0.y584-5AxhqIvw0H0d3IUacslF32l27tooWIkgrbviM4";
        String redisKey = SecureUtil.MD5Encode(String.format("[DataCenter][privateKey][%s]",token));
        System.out.println(redisKey);

    }

    @Test public void getrediskey(){
        String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IkxPSUUiLCJleHAiOjE2ODQwODU0ODQsInVzZXIiOiJhZG1pbiIsImlhdCI6MTY4NDA2NzQ4NH0.KNboMJDQ1dzeDzaRpUJ4TPlvcutQjSzvYkhotw09i4U";
        String redisKey = SecureUtil.MD5Encode(String.format("[DataCenter][secretKey][%s]",token));
        System.out.println(redisKey);

    }
    @Test
    public void AES() throws Exception {
//        String msg="{\"user\":\"\",\"name\":\"\",\"isLocked\":\"\",\"dataAuthority\":\"\",\"roleId\":\"\",\"pageSize\":9,\"pageIndex\":0}";
//         //msg="2knIueI1tjiHYV0aVybYgWzOQOChw+xlKQy1H1+DcPTt+T//TZ2Id+ybYEd4sl2LxAmwx+30I/7MZkp3O6LrG9ExTk9Kp35cpQZ1AcF5hcTMqNjVwqWd/TwLGWxOgaZs";
        String key="dfad6077f3fc494cbf8102cc602f15da";
//        //String mwMsg = SecureUtil.decryptAES(msg, key);
//        String mwMsg = SecureUtil.encryptAES(msg, key);
        String mwMsg="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";
        System.out.println(mwMsg);
         mwMsg = SecureUtil.decryptAES(mwMsg, key);
        System.out.println(mwMsg);
    }



    @Test
    public void get_menu() throws Exception {
        CloseableHttpResponse response1 = null;
        CloseableHttpClient httpclient = HttpClients.createDefault();


        //String url="http://localhost:9200/api/setAES";

        String url="http://localhost:8020/service-flow/api/getMenu";
        //String url="http://localhost:8090/QianchengAPI/API/SendToSpdb/ordLndStQry";
        JSONObject object = new JSONObject();



        HttpPost httpPost = new HttpPost(url);
        String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IkxPSUUiLCJleHAiOjE2ODQ2Njg2NTQsInVzZXIiOiJhZG1pbiIsImlhdCI6MTY4NDY1MDY1NH0.YJknwpiOl6mRS7ZYKiEuYqNwdzMRRcGsAebxyL_adKE";
        String msg="{\"user\":\"\",\"name\":\"\",\"flag\":1,\"dataAuthority\":\"\",\"roleId\":\"\",\"pageSize\":9,\"pageIndex\":0}";
        String key="dfad6077f3fc494cbf8102cc602f15da";
        String mwMsg = SecureUtil.encryptAES(msg, key);
        System.out.println(mwMsg);
        httpPost.setEntity(new StringEntity(mwMsg, StandardCharsets.UTF_8));

        //String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IkxPSUUiLCJleHAiOjE2ODQwMDc0MTQsInVzZXIiOiJhZG1pbiIsImlhdCI6MTY4Mzk4OTQxNH0._LYWBPBqfBYYpDuJ4d1HQK6dAvavkuLLUhT4sSBeBCc";
        //httpPost.setHeader("Content-Type", "application/text;charset=utf8");
//        httpPost.setHeader("Authorization",token);
        httpPost.setHeader("Authorization",token);
        httpPost.setHeader("Content-type", "application/json");




        //httpPost.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
        response1 = httpclient.execute(httpPost);
        System.out.println("response1"+response1);

        HttpEntity entity = response1.getEntity();
        if (entity != null) {
            //按指定编码转换结果实体为String类型
            String body = EntityUtils.toString(entity, "UTF-8");
            JSONObject json1=JSON.parseObject(body);

            System.out.println(body);
            mwMsg = SecureUtil.decryptAES(json1.getString("data"), key);
            System.out.println(mwMsg);


        }


    }

    @Test
    public void get_module_list() throws Exception {
        CloseableHttpResponse response1 = null;
        CloseableHttpClient httpclient = HttpClients.createDefault();


        //String url="http://localhost:9200/api/setAES";

        String url="http://localhost:8020/service-flow/itemsscan/items_modeulelist";
        //String url="http://localhost:8090/QianchengAPI/API/SendToSpdb/ordLndStQry";
        JSONObject object = new JSONObject();



        HttpPost httpPost = new HttpPost(url);
        String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IkxPSUUiLCJleHAiOjE2ODQ2Njg2NTQsInVzZXIiOiJhZG1pbiIsImlhdCI6MTY4NDY1MDY1NH0.YJknwpiOl6mRS7ZYKiEuYqNwdzMRRcGsAebxyL_adKE";
        String msg="{\"modulename\":\"产品资料\",\"recordid\":\"F12B094E-30DC-4649-B3CE-AD5F1301930E\",\"username\":\"杨永伟\"}";
        String key="dfad6077f3fc494cbf8102cc602f15da";
        String mwMsg = SecureUtil.encryptAES(msg, key);
        System.out.println(mwMsg);
        httpPost.setEntity(new StringEntity(mwMsg, StandardCharsets.UTF_8));

        //String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IkxPSUUiLCJleHAiOjE2ODQwMDc0MTQsInVzZXIiOiJhZG1pbiIsImlhdCI6MTY4Mzk4OTQxNH0._LYWBPBqfBYYpDuJ4d1HQK6dAvavkuLLUhT4sSBeBCc";
        //httpPost.setHeader("Content-Type", "application/text;charset=utf8");
//        httpPost.setHeader("Authorization",token);
        httpPost.setHeader("Authorization",token);
        httpPost.setHeader("Content-type", "application/json");




        //httpPost.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
        response1 = httpclient.execute(httpPost);
        System.out.println("response1"+response1);

        HttpEntity entity = response1.getEntity();
        if (entity != null) {
            //按指定编码转换结果实体为String类型
            String body = EntityUtils.toString(entity, "UTF-8");
            JSONObject json1=JSON.parseObject(body);

            System.out.println(body);
            mwMsg = SecureUtil.decryptAES(json1.getString("data"), key);
            System.out.println(mwMsg);


        }


    }







    @Test
    public void token() throws Exception {
        String str= UUID.randomUUID().toString().replace("-","");
        System.out.println(str);
        String publickey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDP6njJSAGhC0DFlks0rweSB0pFbeIJ3h/RjeTU\r\nfR/IXXdRuoCEG/q/rUm7nAy5dPCYcFjvy/jlvv0XqoG+m/XIFMbXkmKBsHza2hZGI1Fwb4Vr6liI\r\ngtDxSZi2Yd8YkCtq55qe5CHJHI+eZAZWn/8CmJ6oleiyx01nhfJLB6wclQIDAQAB\r\n";              ;

        String resJiami=RsaUtil.encryptRSA(str, publickey);
        System.out.println(resJiami);
        String privatekey="MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAM/qeMlIAaELQMWWSzSvB5IHSkVt\n" +
                "4gneH9GN5NR9H8hdd1G6gIQb+r+tSbucDLl08JhwWO/L+OW+/Reqgb6b9cgUxteSYoGwfNraFkYj\n" +
                "UXBvhWvqWIiC0PFJmLZh3xiQK2rnmp7kIckcj55kBlaf/wKYnqiV6LLHTWeF8ksHrByVAgMBAAEC\n" +
                "gYAUh3tLrI90nk7T86YTWqDtu0iLGHF0NfmAUHlivcQQnaH1cOvVn4mfuXWJT7w156UF+Dnf240E\n" +
                "6lnFJ3HOJ0oaPNobhYU7FNUIOpjQFLdo50A3AMVgrpKwNi/rJLczwCF/o/ZGOkPfTJ3zRBKsqxI8\n" +
                "JYP2UPWuAkm8OaJermVD4QJBAOpaYcChL98yd2dTyu/M4O3djSLAQCCYUOlN8sAXBcklTpER4mnI\n" +
                "Tn9lsymboZHRVsQsas+urxTyjsrnuNvVgT0CQQDjHvH6E+Y/lR30Pdh3Jd3Fk9eeolA3/q2ODyHr\n" +
                "qwRdMCI243tg6GQVk/KBqzO9ekC/b1wpDOp/XuauW7LHZQ45AkEAlw9TW1uLBA//r3bvpMsnYawh\n" +
                "wXiy3U/RN9Gq2+77J8EId7JTg2Q+VRg0+Gj9KIULrMAEyYIMETCYomnjWrCw8QJACB+LOA6OJagH\n" +
                "sjykCV7pV6+5/op/pAEP5AzWgb9UIKEgGCZ6uzSUn9Dy04B0EUrWFgK9oRo9KOEUDxhohIkwwQJA\n" +
                "LNBOAh9kJf8jLkWWEd6+5z5SHLIjCAMQi65E2KyjgSr50iMGBdx0ERrwaJ0u/ULiqWtF3q0UHTd2\n" +
                "rK9NnHO0Pg==";
        String mwMsg = RsaUtil.decrypt(resJiami, privatekey);
        System.out.println(mwMsg);

    }
    @Test
    public void userlist(){
//        LoginBO bo=new LoginBO();
//        bo.setUserName("admin");
//        //2023-05-10 23:48:51loie_api25D55AD283AA400AF464C76D713C07AD
//        bo.setLoginDate("2023-05-10 23:48:51");
//        UserListBO userListBO = userListService.getUserInfoByUser(bo.getUserName());
//        //System.out.println(userListBO);
//        if (userListBO != null) {
//            String id = userListBO.getId();
//            String password = userListBO.getPassword();
//            password="qiancheng";
//            password=SecureUtil.MD5Encode(password);
//            System.out.println(password);
//            String comparePasswd = bo.getLoginDate() + SLAT + password;
//            System.out.println(comparePasswd);
//            String enComparePasswd = SecureUtil.MD5Encode(comparePasswd);
//            System.out.println(enComparePasswd);
        Set<String> keys = redisTemplate.keys("*");
        System.out.println(keys);

            //LoginBO(id=null, password=B1040B7A4C3E4B7A3202647AAF57616D, userName=admin, loginDate=2023-05-10 20:30:20, newPassword=null, currentDate=null)
//            if (StringUtils.isNotBlank(id) && StringUtils.isNotBlank(password)
//                    && !"1".equals(userListBO.getIsLocked())) {
//                String comparePasswd = bo.getLoginDate() + SLAT + password;
//                String enComparePasswd = SecureUtil.MD5Encode(comparePasswd);
//                System.out.println(enComparePasswd);
////            }
//        }
    }
}
